﻿// ******************************************************************
// * Copyright(c)  Steven Lu
// * Description   : Entity_MST_AREA
// * CreateDate    : 2011/8/18 15:39:41
// * Creater       : CodeSmith
// * LastChangeDate: 2011/8/18 15:39:41
// * LastChanger   : 2011/8/18 15:39:41
// * Version Info  : 1.0 For ESOL
// ******************************************************************

using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using Suzsoft.Smart.EntityCore;
using ESOL.Common.Schema;

namespace ESOL.Common.Entity
{
    [Serializable]
    public partial class MstAreaEntity : EntityBase
    {
        public MstAreaTable TableSchema
        {
            get
            {
                return MstAreaTable.Current;
            }
        }

        public MstAreaEntity()
        {

        }

        public MstAreaEntity(DataRow dr)
        {
            if (dr == null)
            {
                return;
            }
            this.AreaId = Convert.ToString(CommonFunctions.ToObject(dr["AREA_ID"]));
            this.ParentAreaId = Convert.ToString(CommonFunctions.ToObject(dr["PARENT_AREA_ID"]));
            this.AreaType = Convert.ToString(CommonFunctions.ToObject(dr["AREA_TYPE"]));
            this.AreaName = Convert.ToString(CommonFunctions.ToObject(dr["AREA_NAME"]));
        }

        public MstAreaEntity(DataRowView dr)
        {
            if (dr == null)
            {
                return;
            }
            this.AreaId = Convert.ToString(CommonFunctions.ToObject(dr["AREA_ID"]));
            this.ParentAreaId = Convert.ToString(CommonFunctions.ToObject(dr["PARENT_AREA_ID"]));
            this.AreaType = Convert.ToString(CommonFunctions.ToObject(dr["AREA_TYPE"]));
            this.AreaName = Convert.ToString(CommonFunctions.ToObject(dr["AREA_NAME"]));
        }

        public override TableInfo OringTableSchema
        {
            get
            {
                return MstAreaTable.Current;
            }
        }

        #region Perporty List
        public string AreaId
        {
            get { return Convert.ToString(GetData(MstAreaTable.C_AREA_ID)); }
            set { SetData(MstAreaTable.C_AREA_ID, value); }
        }

        public string ParentAreaId
        {
            get { return Convert.ToString(GetData(MstAreaTable.C_PARENT_AREA_ID)); }
            set { SetData(MstAreaTable.C_PARENT_AREA_ID, value); }
        }

        public string AreaType
        {
            get { return Convert.ToString(GetData(MstAreaTable.C_AREA_TYPE)); }
            set { SetData(MstAreaTable.C_AREA_TYPE, value); }
        }

        public string AreaName
        {
            get { return Convert.ToString(GetData(MstAreaTable.C_AREA_NAME)); }
            set { SetData(MstAreaTable.C_AREA_NAME, value); }
        }

        #endregion
    }


}

